const highLight = (str: string, keyword: string) => {
  // return str.replace(
  // 修复字符串高亮bug: 没有搜索建议时,后端返回的是[null]。null.replace会报错
  return String(str).replace(
    new RegExp(keyword, 'gi'),
    (match) => `<span style='color:red' >${match}</span>`
  )
}
export default highLight
